package com.bugRecord.service.show;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.bugRecord.bean.Bug;
import com.bugRecord.dao.DaoFactory;
import com.bugRecord.dao.IBugRecordDao;

public class ShowByBugNameService implements IShowMoreService {

	public List<Object> showMoreObject(String message) {
		String sql = "select * from bug where bugname like '"+message+"%'";
		IBugRecordDao dao =  DaoFactory.createDao("access");
		List<Map> result = dao.selectAll(sql);
		List<Object> listo = new ArrayList<Object>();
		for(Map m : result)
		{
			Bug bug = new Bug();
			bug.setBugID(Integer.valueOf(m.get("bugID").toString()));
			bug.setBugName(m.get("bugName").toString());
			bug.setCreateDate(m.get("createDate").toString());
			listo.add(bug);
		}
		return listo;
	}

}
